package com.limit.aop;

import com.jfinal.aop.Interceptor;
import com.jfinal.core.ActionInvocation;
import com.jfinal.core.Controller;
import com.limit.constant.Constant;
import com.limit.utils.PropertiesUtil;
/**
 * @Description:如果未登录带service参数则跳转到	admin/login.html
 * @author maoyun(maoyun0903@163.com)
 * @date 2014-1-8 上午11:19:03 
 * @version V1.0
 */
public class AdminLoginAOP implements Interceptor {

	@Override
	public void intercept(ActionInvocation ai) {
		
		Controller c = ai.getController();
		Object status = c.getSessionAttr(Constant.AdminLoginTag);
		// 检测是否登陆
		if(null == status || !status.equals("true")){
			
			ai.getController().render("/admin/login.html");
			return ;
		}
		
		ai.invoke();
	}


}
